package twinkleberry

import java.io.File
import twinkleberry.Util._
import scala.collection.immutable.TreeSet
import collection.mutable.HashMap

object CreateAllArtistPlaylist {
  def main(args:Array[String]) {
    val root = new File("/Users/Shared/Dropbox")
    val musicRoot = new File(root, "music");
    val sampleSongForArtist = new HashMap[String, String]
    for (f <- musicRoot.findFiles() if f.getName.endsWith("mp3")) {
      val artist = SongMetadata.getArtist(f)
      sampleSongForArtist += (artist.getOrElse("No Artist") -> f.removeRoot(musicRoot))        
    }

    for ( (artist, sampleSong) <- sampleSongForArtist) {
      println(<item type="artist" value={artist} notes={sampleSong}/>)
    }
  }
}
